package henu.graduation_design.tool;

import java.util.HashMap;

import org.json.JSONException;
import org.json.JSONObject;

public class AnalyseProductInfoJson {

	private JSONObject jsonObject;

	public AnalyseProductInfoJson(JSONObject jsonObject) {
		this.jsonObject = jsonObject;
	}

	public HashMap<String, Object> getProduct() throws JSONException {

		HashMap<String, Object> temp = new HashMap<String, Object>();
		temp.put("imageUri", jsonObject.getString("imageUri"));
		temp.put("name", jsonObject.getString("name"));
		temp.put("id", jsonObject.getInt("id"));
		temp.put("category", jsonObject.getString("categoryName"));
		temp.put("intro", jsonObject.getString("intro"));
		temp.put("sellQuantity", jsonObject.getInt("sellQuantity"));
		temp.put("price", jsonObject.getDouble("price"));
		temp.put("originalPrice", jsonObject.getDouble("originalPrice"));
		return temp;

	}

}
